<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>微信公众平台管理系统</title>
        <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <include file="Public:header" />
        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="__PUBLIC__/js/html5.js"></script>
        <![endif]-->
    </head>

    <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
    <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
    <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
    <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!--> 
    <body class="">
        <!--<![endif]-->

        <!--顶部菜单-->
        <include file="Public:navbar" />

        <!--左侧导航条-->
        <include file="Public:nav" />

        <!--右侧整体区域-->
        <div class="content">
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="row-fluid">
                        <!--右侧内容start-->
                        <div class="block">
                            <a class="block-heading" data-toggle="collapse">微信菜单管理</a>
                            <div class="block-body collapse in">

                                <div class="container-fluid">
                                    <!--右侧栏目内容区域start-->
                                    <div class="row" style="margin-top:10px;">
                                        <div class="span12">
                                            <div class="pull-left">
                                                <php>if(check_auth('Config/WeixinMenu/add')){</php><a href="{:U($module_name.'/add')}" class="btn btn-primary">新增菜单</a>&nbsp;&nbsp;<php>}</php>
                                                <a class="btn btn-primary" href="{:U($module_name.'/get_weixin_server_menu')}">查询当前菜单</a>&nbsp;&nbsp;
                                                <php>if(check_auth('Config/WeixinMenu/upload_server')){</php><a class="btn btn-primary" id="put_weixin_server">上传到微信服务器</a>&nbsp;&nbsp;<php>}</php>
                                                <php>if(check_auth('Config/WeixinMenu/delete_server')){</php><a class="btn btn-primary" id="delete_weixin_menu">删除微信服务器菜单</a><php>}</php>
                                            </div>
                                        </div>
                                        <!--列表区域start-->
                                        <div class="span12" style="margin-top:10px;">
                                            <div id='pop'></div>
                                            <table class="table table-hover">
                                                <thead>
                                                    <tr>
                                                        <th>ID</th>
                                                        <th>菜单名称</th>
                                                        <th>菜单响应KEY</th>
                                                        <th>子菜单数量</th>
                                                        <th>排序</th>
                                                        <th>状态</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tfoot>
                                                    <tr>
                                                        <td colspan="7"><div class="row pagination page"><div class="span12">{$page}</div></div></td>
                                                    </tr>
                                                </tfoot>
                                                <tbody>
                                                <foreach name='list' item='vo'>
                                                    <tr id='tr_{$vo.id}'>
                                                        <td>{$vo.id}</td>
                                                        <td>{$vo.name}</td>
                                                        <td>{$vo.menu_key}</td>
                                                        <td>{:get_submenu_count($vo['id'])}</td>
                                                        <td>{$vo.sort}</td>
                                                        <td>{:get_status_img($vo['status'])}</td>
                                                        <td>
                                                    <php>if(check_auth('Config/WeixinMenu/edit')){</php><a href="{:U($module_name.'/edit?id='.$vo['id'])}">编辑</a>&nbsp;&nbsp;<php>}</php>
                                                    <php>if(check_auth('Config/WeixinMenu/submenu')){</php><a href="{:U($module_name.'/index_submenu?menu_id='.$vo['id'])}">子菜单管理</a>&nbsp;&nbsp;<php>}</php>
                                                    <php>if(check_auth('Config/WeixinMenu/delete')){</php><a href="###" onclick="delete_tr({$vo.id});">删除</a><php>}</php>
                                                    </td>
                                                    </tr>
                                                </foreach>
                                                </tbody>
                                            </table>
                                        </div>
                                        <!--列表区域end-->
                                    </div>
                                    <!--右侧栏目内容区域end-->
                                </div>

                            </div>
                        </div>
                        <!--右侧内容end-->

                    </div>
                    <footer>
                        <include file="Public:footer" />
                    </footer>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="__PUBLIC__/js/list.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/weixin_menu_action.js"></script>
    </body>
</html>


